/*Gender Quotas and the Qualifications of Parliamentarians
The Journal of Politics, 2023
Andrea Aldrich & William Daniel
correspondence: andrea.aldrich@yale.edu
Last Modification 5/3/2023
Stata Version 15.1
Operating System: Micrsoft Windows 10 Enterprise 
*/

/*----------------------------------------------------------------------------//
	Install necessary programs if needed
//----------------------------------------------------------------------------*/
	*outreg2
	*coefplot
	*grc1leg


/*----------------------------------------------------------------------------//
	Choose Wroking Directory
//----------------------------------------------------------------------------*/

 *define directoy to folder were replication was unzipped
	*cd "Your Working Directory here"
	
/*----------------------------------------------------------------------------//
	Main Text Analysis 
//----------------------------------------------------------------------------*/

	use Aldrich_Daniel_2023_PARTY, clear  //this is eduaction data at the PARTY level

/*----------------------------------------------------------------------------//
	Set panel settings
//----------------------------------------------------------------------------*/
		
***set panel settings
	xtset PARTYID WAVE
	encode COUNTRY, generate(ccode)
	
/*----------------------------------------------------------------------------//
	Table A1 Summary Statistics
//----------------------------------------------------------------------------*/	
	
	bysort WAVE: sum PARTYID if maxrun >=2
	bysort WAVE: tab COUNTRY if maxrun >=2
	bysort WAVE: sum psWomen if maxrun >=2
	sum psWomen if maxrun>=2
	bysort WAVE: sum ps_ugrad_min if maxrun >=2
	sum ps_ugrad_min if maxrun>=2
	bysort WAVE: sum ps_pgrad_min if maxrun >=2
	sum ps_pgrad_min if maxrun >=2
	
	
/*----------------------------------------------------------------------------//
	Table A4 Women as share of party 
//----------------------------------------------------------------------------*/

	xtreg psWomen any_quota  i.WAVE  if maxrun >=2, fe cluster(ccode)
	est store a4_1
	xtreg psWomen any_quota i.WAVE Left#i.WAVE c.w1_MEPS#i.WAVE if maxrun>=2, fe cluster(ccode)
	est store a4_2
	xtreg psWomen any_quota i.WAVE if nPARTYID>2 & maxrun>=2, fe cluster(ccode)	
	est store a4_3
	xtreg psWomen any_quota i.WAVE Left#i.WAVE  c.w1_MEPS#i.WAVE if nPARTYID>2 & maxrun>=2, fe cluster(ccode)
	est store a4_4
	
	
	*create table A4 in Latex
	outreg2[ a4_1 ] using A4, replace nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Control x Wave FE, NO) ctitle("2+ Waves ") title(A4) 
	outreg2[ a4_2 ] using A4,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Control x Wave FE, YES) ctitle( "2+ Waves ") title(A4) 
	outreg2[ a4_3 ] using A4,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Control x Wave FE, NO) ctitle("2+ Waves nMEPS>2 ") title(A4) 
	outreg2[ a4_4 ] using A4,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Control x Wave FE, YES) ctitle("2+ Waves nMEPS>2 ") title(A4) 
															

/*----------------------------------------------------------------------------//
	Table A5 share of education in all, women, and men 
//----------------------------------------------------------------------------*/

	local DV ps_ugrad_min ps_pgrad_min ps_women_ugrad_min ps_women_pgrad_min ps_men_ugrad_min ps_men_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' any_quota i.WAVE if maxrun >=2, fe cluster(ccode)
	est store a5_`var'
	}


	*create table A5 in Latex
	outreg2[ a5_ps_ugrad ] using A5, replace nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A5) 
	outreg2[ a5_ps_pgrad ] using A5,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle( "Postgraduate Degree") title(A5) 
	outreg2[ a5_ps_women_ugrad_min ] using A5,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A5) 
	outreg2[ a5_ps_women_pgrad_min ] using A5,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A5) 
	outreg2[ a5_ps_men_ugrad_min ] using A5,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A5) 
	outreg2[ a5_ps_men_pgrad_min ] using A5,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A5) 


/*----------------------------------------------------------------------------//
	Table A6 share of education in all, women, and men in parties with more than 2 MEPs
//----------------------------------------------------------------------------*/
	local DV ps_ugrad_min ps_pgrad_min ps_women_ugrad_min ps_women_pgrad_min ps_men_ugrad_min ps_men_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' any_quota i.WAVE if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a6_`var'
	}

outreg2[ a6_ps_ugrad ] using A6, replace nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A6) 
outreg2[ a6_ps_pgrad ] using A6,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle( "Postgraduate Degree") title(A6) 
outreg2[ a6_ps_women_ugrad_min ] using A6,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A6) 
outreg2[ a6_ps_women_pgrad_min ] using A6,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A6) 
outreg2[ a6_ps_men_ugrad_min ] using A6,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A6) 
outreg2[ a6_ps_men_pgrad_min ] using A6,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A6)




		
/*----------------------------------------------------------------------------//
	COUNRY LEVEL ANALYSIS  A7
//----------------------------------------------------------------------------*/

*Share of educated women or men as share of all women or men

	use Aldrich_Daniel_2023_Country, clear  //country level data set
	

***set panel settings
	encode COUNTRY, generate(ccode)
	xtset ccode WAVE
		

*Table A7 share of educated women as share of all women or men

	
	local DV cs_ugrad_min cs_pgrad_min cs_women_ugrad_min cs_women_pgrad_min cs_men_ugrad_min cs_men_pgrad_min
	
	foreach var in `DV' {
	xtreg `var' national_quota i.WAVE
	est store a7_`var'
	}

	outreg2[a7_cs_ugrad a7_cs_pgrad a7_cs_women_ugrad_min a7_cs_women_pgrad_min a7_cs_men_ugrad_min a7_cs_men_pgrad_min] using A7, ///
	replace nocons label keep (national_quota) addtext(Country Fixed FE, -, Wave FE, -, Control x Wave FE, -) ctitle(" ") title(A7: COUNTRY)tex


outreg2[ a7_cs_ugrad_min ] using A7, replace nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A7) 
outreg2[ a7_cs_pgrad_min ] using A7,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle( "Postgraduate Degree") title(A7) 
outreg2[ a7_cs_women_ugrad_min ] using A7,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A7) 
outreg2[ a7_cs_women_pgrad_min ] using A7,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A7) 
outreg2[ a7_cs_men_ugrad_min ] using A7,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A7) 
outreg2[ a7_cs_men_ugrad_min ] using A7,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A7)
	


/*----------------------------------------------------------------------------//
	SINGLE GENDER MODELS TABLES A8 AND A9
//----------------------------------------------------------------------------*/

	use Aldrich_Daniel_2023_PARTY, clear  //this is eduaction data at the PARTY level


***set panel settings
	xtset PARTYID WAVE
	encode COUNTRY, generate(ccode)
	
	
*Table A8 share of educated women or men as share of all women or men 

	local DV sWomen_ugrad_min sWomen_pgrad_min sMen_ugrad_min sMen_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' any_quota i.WAVE if maxrun >=2, fe cluster(ccode)
	est store a8_`var'
	}


outreg2[ a8_sWomen_ugrad_min ] using A8,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A8: SINGLE GENDER) 
outreg2[ a8_sWomen_pgrad_min ] using A8,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A8: SINGLE GENDER) 
outreg2[ a8_sMen_ugrad_min ] using A8,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A8: SINGLE GENDER) 
outreg2[ a8_sMen_pgrad_min ] using A8,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A8: SINGLE GENDER)

	

*Table A9 share of educated women or men as share of all women or men in large parties

	local DV sWomen_ugrad_min sWomen_pgrad_min sMen_ugrad_min sMen_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' any_quota i.WAVE if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a9_`var'
	}
	
outreg2[ a9_sWomen_ugrad_min ] using A9,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A9: SINGLE GENDER) 
outreg2[ a9_sWomen_pgrad_min ] using A9,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A9: SINGLE GENDER) 
outreg2[ a9_sMen_ugrad_min ] using A9,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A9: SINGLE GENDER) 
outreg2[ a9_sMen_pgrad_min ] using A9,  nocons label keep (any_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A9: SINGLE GENDER)



/*----------------------------------------------------------------------------//
	NATIONAL QUOTAS ONLY A10 ad A11
//----------------------------------------------------------------------------*/

	local DV ps_ugrad_min ps_pgrad_min ps_women_ugrad_min ps_women_pgrad_min ps_men_ugrad_min ps_men_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' national_quota i.WAVE if maxrun >=2, fe cluster(ccode)
	est store a10_`var'
	}

outreg2[ a10_ps_ugrad ] using A10, replace nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A10: NATIONAL QUOTA) 
outreg2[ a10_ps_pgrad ] using A10,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle( "Postgraduate Degree") title(A10: NATIONAL QUOTA) 
outreg2[ a10_ps_women_ugrad_min ] using A10,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A10: NATIONAL QUOTA) 
outreg2[ a10_ps_women_pgrad_min ] using A10,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A10: NATIONAL QUOTA) 
outreg2[ a10_ps_men_ugrad_min ] using A10,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A10: NATIONAL QUOTA) 
outreg2[ a10_ps_men_pgrad_min ] using A10,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A10: NATIONAL QUOTA)


	local DV ps_ugrad_min ps_pgrad_min ps_women_ugrad_min ps_women_pgrad_min ps_men_ugrad_min ps_men_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' national_quota i.WAVE if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a11_`var'
	}

outreg2[ a11_ps_ugrad ] using A11, replace nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A11: NATIONAL QUOTA) 
outreg2[ a11_ps_pgrad ] using A11,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle( "Postgraduate Degree") title(A11: NATIONAL QUOTA) 
outreg2[ a11_ps_women_ugrad_min ] using A11,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A11: NATIONAL QUOTA) 
outreg2[ a11_ps_women_pgrad_min ] using A11,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A11: NATIONAL QUOTA) 
outreg2[ a11_ps_men_ugrad_min ] using A11,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A11: NATIONAL QUOTA) 
outreg2[ a11_ps_men_pgrad_min ] using A11,  nocons label keep (national_quota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A11: NATIONAL QUOTA)

/*----------------------------------------------------------------------------//
	Figure A3 
//----------------------------------------------------------------------------*/

	*Undergraduate degree	     

	coefplot (a10_ps_ugrad_min, msymbol(diamond)) a11_ps_ugrad_min, title(All MEPs) vertical yline(0) keep(national_quota) legend(order(2 "All Party Delegations" 4 " Party Delegations >2"))
		graph save all_ugrad_national, replace
			
	coefplot (a10_ps_women_ugrad_min, msymbol(diamond)) a11_ps_women_ugrad_min, title(All MEPs) vertical yline(0) keep(national_quota) legend(order(2 "All Party Delegations" 4 " Party Delegations >2"))
		graph save women_ugrad_national, replace

	coefplot (a10_ps_men_ugrad_min, msymbol(diamond)) a11_ps_men_ugrad_min, title(All MEPs) vertical yline(0) keep(national_quota) legend(order(2 "All Party Delegations" 4 " Party Delegations >2"))
		graph save men_ugrad_national, replace
			
	grc1leg all_ugrad_national.gph women_ugrad_national.gph men_ugrad_national.gph, title(Undergraduate Degree) col(3) ycommon legendfrom(all_ugrad_national.gph)
		graph save ugrad_coef_national, replace
		
	*Postgradaute degree
	
	coefplot (a10_ps_pgrad_min, msymbol(diamond)) a11_ps_pgrad_min, title(All MEPs) vertical yline(0) keep(national_quota) legend(order(2 "All Party Delegations" 4 " Party Delegations >2"))
		graph save all_pgrad_national, replace
			
	coefplot (a10_ps_women_pgrad_min, msymbol(diamond)) a11_ps_women_pgrad_min, title(All MEPs) vertical yline(0) keep(national_quota) legend(order(2 "All Party Delegations" 4 " Party Delegations >2"))
		graph save women_pgrad_national, replace

	coefplot (a10_ps_men_pgrad_min, msymbol(diamond)) a11_ps_men_pgrad_min, title(All MEPs) vertical yline(0) keep(national_quota) legend(order(2 "All Party Delegations" 4 " Party Delegations >2"))
		graph save men_pgrad_national, replace
			
	grc1leg all_pgrad_national.gph women_pgrad_national.gph men_pgrad_national.gph, title(Postgraduate Degree) col(3) ycommon legendfrom(all_pgrad_national.gph)
		graph save pgrad_coef_national, replace
	
	*both graphs
	grc1leg ugrad_coef_national.gph pgrad_coef_national.gph, title() col(1) ycommon legendfrom(ugrad_coef_national.gph)
		graph save Fig3, replace

/*----------------------------------------------------------------------------//
	VOLUNTARY vs. INVOLUNTARY QUOTAS A
//----------------------------------------------------------------------------*/

*generate new variables for voluntary and involuntary quotas

	gen voluntary=0 if party_quota==0 & national_quota==0
	replace voluntary=0 if party_quota==0 & national_quota==1
	replace voluntary=1 if party_quota==1
	
	gen involuntary=0 if party_quota==1 
	replace involuntary=0 if national_quota==0
	replace involuntary=1 if party_quota==0 & national_quota==1
	
	label variable voluntary "Voluntary Quota"
	label variable involuntary "Involuntary Quota"
	
	local q national_quota party_quota any_quota voluntary involuntary
	foreach var in `q'{
	tab `var' if  maxrun >=2 
	}
	
	*Table A12 Voluntary and Involuntary quotas share of party 
	
	local DV ps_ugrad_min ps_pgrad_min ps_women_ugrad_min ps_women_pgrad_min ps_men_ugrad_min ps_men_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' voluntary involuntary i.WAVE if maxrun >=2, fe cluster(ccode)
	est store a12a_`var'
	}

outreg2[ a12a_ps_ugrad ] using A12a, replace nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A12a) 
outreg2[ a12a_ps_pgrad ] using A12a,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle( "Postgraduate Degree") title(A12a) 
outreg2[ a12a_ps_women_ugrad_min ] using A12a,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A12a) 
outreg2[ a12a_ps_women_pgrad_min ] using A12a,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A12a) 
outreg2[ a12a_ps_men_ugrad_min ] using A12a,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A12a) 
outreg2[ a12a_ps_men_pgrad_min ] using A12a,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A12a)

	local DV ps_ugrad_min ps_pgrad_min ps_women_ugrad_min ps_women_pgrad_min ps_men_ugrad_min ps_men_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' voluntary involuntary i.WAVE if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a12b_`var'
	}

outreg2[ a12b_ps_ugrad ] using A12b, replace nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A12b) 
outreg2[ a12b_ps_pgrad ] using A12b,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle( "Postgraduate Degree") title(A12b) 
outreg2[ a12b_ps_women_ugrad_min ] using A12b,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A12b) 
outreg2[ a12b_ps_women_pgrad_min ] using A12b,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A12b) 
outreg2[ a12b_ps_men_ugrad_min ] using A12b,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A12b) 
outreg2[ a12b_ps_men_pgrad_min ] using A12b,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A12b)


	*Table A13 Voluntary and Involuntary quotas share of single gender 
	local DV sWomen_ugrad_min sWomen_pgrad_min sMen_ugrad_min sMen_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' voluntar involuntary i.WAVE if maxrun >=2, fe cluster(ccode)
	est store a13a_`var'
	}

	outreg2[a13a_sWomen_ugrad_min a13a_sWomen_pgrad_min a13a_sMen_ugrad_min a13a_sMen_pgrad_min] using A13a, ///
	replace nocons label keep (voluntar involuntary) addtext(Party Fixed FE, -, Wave FE, -, Control x Wave FE, -) ctitle(" ") title(A13a) tex
	local DV sWomen_ugrad_min sWomen_pgrad_min sMen_ugrad_min sMen_pgrad_min 
	
outreg2[ a13a_sWomen_ugrad_min ] using A13a,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A13a) 
outreg2[ a13a_sWomen_pgrad_min ] using A13a,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A13a) 
outreg2[ a13a_sMen_ugrad_min ] using A13a,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A13a) 
outreg2[ a13a_sMen_pgrad_min ] using A13a,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A13a)

	foreach var in `DV' {
	xtreg `var' voluntar involuntary i.WAVE if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a13b_`var'
	}

outreg2[ a13b_sWomen_ugrad_min ] using A13b,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A13b) 
outreg2[ a13b_sWomen_pgrad_min ] using A13b,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A13b) 
outreg2[ a13b_sMen_ugrad_min ] using A13b,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(A13b) 
outreg2[ a13b_sMen_pgrad_min ] using A13b,  nocons label keep (voluntary involuntary) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A13b)

/*----------------------------------------------------------------------------//
	Quota strength Data
//----------------------------------------------------------------------------*/	
		
	/*merge QAROT data from Hughes, Melanie M., Pamela Paxton, Amanda Clayton, and 
	Pär Zetterberg. 2017. Quota Adoption and Reform over Time (QAROT), 1947-2015.
	[Computer file]. http://www.pitt.edu/~hughesm/data.html
	
	Hughes, Melanie M., Pamela Paxton, Amanda Clayton, and Pär Zetterberg. 2019. 
	“Global Gender Quota Adoption, Implementation, and Reform.” Comparative Politics.
	51, 2, pp. 219-238.
	*/
	use Aldrich_Daniel_2023_PARTY, clear  //this is eduaction data at the PARTY level
	
***set panel settings
	xtset PARTYID WAVE
	encode COUNTRY, generate(ccode)
	
	merge m:1 ccode WAVE using QAROT_DATA, keepusing(df_threshold effectivequota)
	drop if _merge==2

*update for wave nine
	replace df_threshold=40 if WAVE==9 &(COUNTRY=="Luxembourg" | COUNTRY=="Italy")
	replace effectivequota=1 if COUNTRY=="Luxembourg" & WAVE==9
	replace effectivequota=0 if COUNTRY=="Italy" & WAVE==9
*update italy (only quota in some regions, we don't count it)
	replace df_threshold=0 if COUNTRY=="Italy" & WAVE==4
	
	label variable df_threshold "De Facto Threshold"
	label variable effectivequota "Effective Quota"
	
/*----------------------------------------------------------------------------//
	Code Quota strength for WAVE 9
//----------------------------------------------------------------------------*/	
	*A14 summary statistics
	
	tab effectivequota 
	tab effectivequota if maxrun >=2 
	tab effectivequota if maxrun >=2 & nPARTYID>2

	tab df_threshold if national_quota==0	
	tab df_threshold if national_quota==1
	tab df_threshold if maxrun >=2 & national_quota==0	
	tab df_threshold if maxrun >=2 & national_quota==1
	tab df_threshold if maxrun >=2 & nPARTYID>2 & national_quota==0	
	tab df_threshold if maxrun >=2 & nPARTYID>2 & national_quota==1

/*----------------------------------------------------------------------------//
	Table A15  and A16 share of education in all, women, and men in parties with more than 2 MEPs
//----------------------------------------------------------------------------*/
	
	local DV ps_ugrad_min ps_pgrad_min ps_women_ugrad_min ps_women_pgrad_min ps_men_ugrad_min ps_men_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' effectivequota i.WAVE if maxrun >=2, fe cluster(ccode)
	est store a15a_`var'
	xtreg `var' effectivequota i.WAVE if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a15b_`var'
	xtreg `var' df_threshold i.WAVE if maxrun >=2, fe cluster(ccode)
	est store a16a_`var'
	xtreg `var' df_threshold i.WAVE if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a16b_`var'
	}

	*A15 a & b
outreg2 [a15a_ps_ugrad ] using A15a, replace nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A15a) 
outreg2 [a15a_ps_pgrad ] using A15a,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree") title(A15a) 
outreg2 [a15a_ps_women_ugrad_min] using A15a,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A15a) 
outreg2 [a15a_ps_women_pgrad_min ] using A15a,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A15a) 
outreg2 [a15a_ps_men_ugrad_min ] using A15a,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Men") title(A15a) 
outreg2 [a15a_ps_men_pgrad_min] using A15a,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO,  Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A15a) 

outreg2 [a15b_ps_ugrad ] using A15b, replace nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A15b) 
outreg2 [a15b_ps_pgrad ] using A15b,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree") title(A15b) 
outreg2 [a15b_ps_women_ugrad_min] using A15b,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A15b) 
outreg2 [a15b_ps_women_pgrad_min ] using A15b,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A15b) 
outreg2 [a15b_ps_men_ugrad_min ] using A15b,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Men") title(A15b) 
outreg2 [a15b_ps_men_pgrad_min] using A15b,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO,  Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A15b) 

	*A16 a & b
outreg2 [a16a_ps_ugrad ] using A16a, replace nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A16a) 
outreg2 [a16a_ps_pgrad ] using A16a,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree") title(A16a) 
outreg2 [a16a_ps_women_ugrad_min] using A16a,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A16a) 
outreg2 [a16a_ps_women_pgrad_min ] using A16a,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A16a) 
outreg2 [a16a_ps_men_ugrad_min ] using A16a,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Men") title(A16a) 
outreg2 [a16a_ps_men_pgrad_min] using A16a,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO,  Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A16a) 
	
outreg2 [a16b_ps_ugrad ] using A16b, replace nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(A16b) 
outreg2 [a16b_ps_pgrad ] using A16b,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree") title(A16b) 
outreg2 [a16b_ps_women_ugrad_min] using A16b,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(A16b) 
outreg2 [a16b_ps_women_pgrad_min ] using A16b,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(A16b) 
outreg2 [a16b_ps_men_ugrad_min ] using A16b,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Men") title(A16b) 
outreg2 [a16b_ps_men_pgrad_min] using A16b,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO,  Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(A16b) 
	

	
	
	local DV sWomen_ugrad_min sWomen_pgrad_min sMen_ugrad_min sMen_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' effectivequota i.WAVE if maxrun >=2 , fe cluster(ccode)
	est store a17a_`var'
	xtreg `var' effectivequota i.WAVE if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a17b_`var'
	xtreg `var' df_threshold i.WAVE if maxrun >=2 , fe cluster(ccode)
	est store a18a_`var'
	xtreg `var' df_threshold i.WAVE if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a18b_`var'
	}

	*Table A17 & b
outreg2 [a17a_sWomen_ugrad_min] using A15c,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(a17a) 
outreg2 [a17a_sWomen_pgrad_min] using A15c,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(a17a) 
outreg2 [a17a_sMen_ugrad_min ] using A15c,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Men") title(a17a) 
outreg2 [a17a_sMen_pgrad_min] using A15c,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO,  Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(a17a) 


outreg2 [a17b_sWomen_ugrad_min] using A15d,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(a17b) 
outreg2 [a17b_sWomen_pgrad_min ] using A15d,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(a17b) 
outreg2 [a17b_sMen_ugrad_min ] using A15d,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Men") title(a17b) 
outreg2 [a17b_sMen_pgrad_min] using A15d,  nocons label keep (effectivequota) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO,  Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(a17b) 
	
	*Table 18 a & b
outreg2 [a18a_sWomen_ugrad_min] using A16c,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(a18a) 
outreg2 [a18a_sWomen_pgrad_min ] using A16c,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(a18a) 
outreg2 [a18a_sMen_ugrad_min ] using A16c,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Men") title(a18a) 
outreg2 [a18a_sMen_pgrad_min] using A16c,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO,  Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(a18a) 

outreg2 [a18b_sWomen_ugrad_min] using A16d,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(a18b) 
outreg2 [a18b_sWomen_pgrad_min ] using A16d,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO)ctitle("Postgraduate Degree Women") title(a18b) 
outreg2 [a18b_sMen_ugrad_min] using A16d,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO, Control x Wave FE, NO) ctitle("Undergraduate Degree Men") title(a18b) 
outreg2 [a18b_sMen_pgrad_min] using A16d,  nocons label keep (df_threshold) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x WAVE FE, NO,  Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(a18b) 
	

/*----------------------------------------------------------------------------//
	INCORPORATING TIME A19 A20
//----------------------------------------------------------------------------*/	
	
	gen quota_wave=national_quota*WAVE
	
	gen q1=0 
	replace q1=1 if national_quota==1 & WAVE==1
	
	gen q2=0 
	replace q2=1 if national_quota==2 & WAVE==2
	
	gen q3=0 
	replace q3=1 if national_quota==3 & WAVE==3
	
	gen q4=0
	replace q4=1 if national_quota==1 & WAVE==4
	
	gen q5=0
	replace q5=1 if national_quota==1 & WAVE==5
	label variable q5 "Quota X WAVE 5"
	
	gen q6=0
	replace q6=1 if national_quota==1 & WAVE==6
	label variable q6 "Quota X WAVE 6"

	gen q7=0
	replace q7=1 if national_quota==1 & WAVE==7
	label variable q7 "Quota X WAVE 7"

	gen q8=0
	replace q8=1 if national_quota==1 & WAVE==8
	label variable q8 "Quota X WAVE 8"

	gen q9=0
	replace q9=1 if national_quota==1 & WAVE==9
	label variable q9 "Quota X WAVE 9"

		
	local DV ps_ugrad_min ps_pgrad_min ps_women_ugrad_min ps_women_pgrad_min ps_men_ugrad_min ps_men_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' national_quota i.WAVE  q5 q6 q7 q8 q9 if maxrun >=2, fe cluster(ccode)
	est store a19_`var'
	xtreg `var' national_quota i.WAVE  q5 q6 q7 q8 q9 if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a20_`var'
	}
		
outreg2[ a19_ps_ugrad_min ] using A19, replace nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(a19) 
outreg2[ a19_ps_pgrad_min] using A19,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle( "Postgraduate Degree") title(a19) 
outreg2[ a19_ps_women_ugrad_min ] using A19,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(a19) 
outreg2[ a19_ps_women_pgrad_min ] using A19,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(a19) 
outreg2[ a19_ps_men_ugrad_min ] using A19,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(a19) 
outreg2[ a19_ps_men_pgrad_min ] using A19,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(a19)
	
outreg2[ a20_ps_ugrad_min ] using A20, replace nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Undergraduate Degree") title(a20) 
outreg2[ a20_ps_pgrad_min ] using A20,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle( "Postgraduate Degree") title(a20) 
outreg2[ a20_ps_women_ugrad_min ] using A20,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(a20) 
outreg2[ a20_ps_women_pgrad_min ] using A20,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(Aa2018) 
outreg2[ a20_ps_men_ugrad_min ] using A20,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(a20) 
outreg2[ a20_ps_men_pgrad_min ] using A20,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(a20)
	
	
	*single gender with time 
	
	
	local DV sWomen_ugrad_min sWomen_pgrad_min sMen_ugrad_min sMen_pgrad_min 
	
	foreach var in `DV' {
	xtreg `var' national_quota i.WAVE  q5 q6 q7 q8 q9 if maxrun >=2, fe cluster(ccode)
	est store a21_`var'
	xtreg `var' national_quota i.WAVE  q5 q6 q7 q8 q9 if maxrun >=2 & nPARTYID>2, fe cluster(ccode)
	est store a22_`var'
	}

outreg2[ a21_sWomen_ugrad_min ] using A21,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(a21) 
outreg2[ a21_sWomen_pgrad_min ] using A21,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(a21) 
outreg2[ a21_sMen_ugrad_min ] using A21,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(a21) 
outreg2[ a21_sMen_pgrad_min ] using A21,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(a21)
	
outreg2[ a22_sWomen_ugrad_min ] using A22,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Undergraduate Degree Women") title(a22) 
outreg2[ a22_sWomen_pgrad_min ] using A22,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Postgraduate Degree Women") title(a22) 
outreg2[ a22_sMen_ugrad_min ] using A22,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO)ctitle("Undertaduate Degree Men") title(a22) 
outreg2[ a22_sMen_pgrad_min ] using A22,  nocons label keep (national_quota i.WAVE q2 q3 q4 q5 q6 q7 q8 q9) addtext(Party Fixed FE, YES, Wave FE, YES, Quota x Wave FE, YES, Control x Wave FE, NO) ctitle("Postgraduate Degree Men") title(a22)
	




//----------------------------------------------------------------------------*/	


